#include "ProcessPool.hpp"
#include "Task.hpp"

void Usage(string proc)
{
    cout << "Usage" << proc << "prcocess-numm" << endl;
}

int main(int argc, char *argv[])
{

    if (argc != 2)
    {
        Usage(argv[0]);
        return UsageError;
    }
    int num = stoi(argv[1]);
    ProcessPool *pp = new ProcessPool(num,Worker);

    pp->InitProcessPool();
    pp->DispatchTask();
    pp->CleanProcessPool();

    // vector<Channel> channels;
    // //1. 初始化进程池
    // InitProcessPool(num,channels,Worker);


    // //2. 派发任务
    // DispatchTask(channels);
   

    // //3. 退出进程池
    // CleanProcessPool(channels);

    
    return OK;
}